package com.demo.adaptdemo;

import android.app.ListActivity;
import android.os.Bundle;
import android.os.PersistableBundle;

import java.util.List;

/**
 * Created by Administrator on 2016/3/22.
 */
public class NewsListActivity extends ListActivity {
    private List<News> data;

    public void init(){
        News n1 = new News(R.drawable.a,"nv1","dslkjlwqd");
        News n2 = new News(R.drawable.b,"nv2","dslkjlwqd");
        News n3 = new News(R.drawable.c,"nv3","dslkjlwqd");
        data.add(n1);data.add(n2);data.add(n3);
    }

    @Override
    public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
        init();
        MyAdapter myAdapter = new MyAdapter(this,data);
        setListAdapter(myAdapter);

        super.onCreate(savedInstanceState, persistentState);
    }
}
